#include "cJSON/cJSON.h"
#include "log/log.h"

int main(int argc, char *argv[]){
    cJSON *root_obj = cJSON_CreateObject();

    cJSON_AddStringToObject(root_obj, "name", "hb");
    cJSON_AddNumberToObject(root_obj, "age", 18);

    char *json_str = cJSON_PrintUnformatted(root_obj);
    log_debug("json_str: %s", json_str);

    char *name = cJSON_GetObjectItem(root_obj, "name")->valuestring;
    int age = cJSON_GetObjectItem(root_obj, "age")->valueint;
    log_debug("name: %s, age: %d", name, age);
}